<?php

class InputValidation {
    private $mInput;
    private $mPattern;
    
    public function __construct($pInput=null, $pPattern=null) {
        $this->mInput= $pInput;
        $this->mPattern= $pPattern;        
    }
    
    public function CheckValidation() {
        if (preg_match($this->mPattern, $this->mInput) != 0) {
            $tResult = $this->mInput;
            $tResult = trim($tResult);
            return $tResult;
        } else {
            return FALSE;
        }
    }
    
    public function SetInput($pInput){
        $this->mInput= $pInput;
    }
    
    public function GetInput(){
        return $this->mInput;
    }
    
    public function SetPattern($pPattern){
        $this->mPattern= $pPattern;
    }
    

}